let ajaxTimes=0;
export const request=(params, baseUrl)=>{
    ajaxTimes++;
    wx.showLoading({
        title: "加载中",
        mask: true
    });

    console.log(baseUrl + params.url)
    //定义公共url
    return new Promise((resovle,reject)=>{
        wx.request({
            ...params,
            url: baseUrl+params.url,
            success:(result)=>{
                resovle(result);
            },
            fail:(err)=>{
                reject(err);
            },
            complete:()=>{
                ajaxTimes--;
                if(ajaxTimes===0){
                    wx.hideLoading();
                }
            }
        });
    })
}

export const requestD=(params)=>{
    return request(params, "https://www.t-c33.com/shequapi/");
    //https://t-c33.com/shequapi/
    //https://shequapi.applinzi.com/
}

